﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Sponsorship.Infrastructure.BootStrapping;
using StructureMap;
using Sponsorship.ReadModel;
using Raven.Client.Document;

namespace Sponsorship.Ui.Wpf
{
    /// <summary>
    /// Interaktionslogik für "App.xaml"
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            InitializeInfrastructure();
        }

        private static void InitializeInfrastructure()
        {
            //use RavenDB Server as an event store and persists the read side (views) also to RavenDB Server
            var viewStore = new DocumentStore { ConnectionStringName = BootStrapper.RavenDbConnectionStringName };
            viewStore.Initialize();

            var consistentViewStore = new QueryYourWritesDocumentStoreDecorator(viewStore);

            IContainer container = BootStrapper.BootStrap(consistentViewStore);
        }
    }
}
